package org.shilong.MContext.WebRequest;

import org.shilong.MInterface.WebRequestInterface.HttpRequestInterface;

/**
 * 网络访问上下文
 * @author Administrator
 *
 */
public class WebRequestContext {

	public final static String TYPE_LOGIN = "org.shilong.MImpl.WebRequest.LoginHttpRequestImpl";

	public final static String TYPE_REGISTER = "org.shilong.MImpl.WebRequest.RegisterHttpRequestImpl";

	public final static String TYPE_LOGIN_GET_USER_INFO = "org.shilong.MImpl.WebRequest.GetUserInfoHttpRequestImpl";

	public final static String TYPE_CREATE_BUSINESS_CARD = "org.shilong.MImpl.WebRequest.CreateBusinessCardHttpRequestImpl";

	public final static String TYPE_ALERT_BUSINESS_CARD = "org.shilong.MImpl.WebRequest.AlertBusinessCardHttpRequestImpl";

	public final static String TYPE_QUERY_BUSINESS_CARD = "org.shilong.MImpl.WebRequest.QueryBusinessCardImpl";

	public final static String TYPE_ADD_NEW_PARTY = "org.shilong.MImpl.WebRequest.AddNewPartyHttpRequestImpl";

	public final static String TYPE_QUERY_NEW_PARTY_CREATED_BY_ME = "org.shilong.MImpl.WebRequest.QueryPariesOriginateByMeHttpRequestImpl"; 

	public final static String TYPE_QUERY_ALL_PARIES = "org.shilong.MImpl.WebRequest.QueryAllPariesHttpRequestImpl";

	public final static String TYPE_COMMENT_PARTY = "org.shilong.MImpl.WebRequest.CommentPartyHttpRequestImpl";

	public final static String TYPE_TAKE_PART_IN_PARTY = "org.shilong.MImpl.WebRequest.TakePartInPartyHttpRequestImpl";

	public final static String TYPE_PARIES_ME_TAKE_PART_IN_PARTY = "org.shilong.MImpl.WebRequest.QueryPariesMeTakePartInHttpRequestImpl";

	/*查询我的聚会httprequest */
	public final static String TYPE_QUERY_MY_PARTY = "org.shilong.MImpl.WebRequest.QueryMyPariesHttpRequestImpl";
	
	/*添加参加聚会人httprequest */
	public final static String TYPE_ADD_PEOPEL_TAKE_PART_IN_PARTY = "org.shilong.MImpl.WebRequest.AddPeopleWhoTakeInImpl";
	
	/*添加微博好友httprequest */
	public final static String TYPE_ADD_WEIBO_FRIEND = "org.shilong.MImpl.WebRequest.AddFriendHttpRequestImpl";
	
	/*查询httprequest */
	public final static String TYPE_QUERY_COMMENT_Party = "org.shilong.MImpl.WebRequest.QueryCommentsImpl";
	
	public final static String TYPE_QUERY_BusinessCard_BY_ID = "org.shilong.MImpl.WebRequest.QueryBusinessCardByIDHttpRequestImpl";
	
	public final static String TYPE_QUERY_WEIBO_FRIEND = "org.shilong.MImpl.WebRequest.QueryWeibBoFriendHttpImpl";
	
	
	private static HttpRequestInterface HRI = null;

	public static HttpRequestInterface createInstance( String type ){

		HRI = null;
		try {

			HRI = (HttpRequestInterface)Class.forName( type ).newInstance();

		} catch (InstantiationException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IllegalAccessException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (ClassNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

		return HRI;
	}
}
